home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / B-C / C++ FAQ Reference 1.0 / C++ FAQ Reference 1.0.rsrc / TEXT_1039.txt < prev    next >
Encoding:
Text File  |  1993-06-30  |  980 b   |  10 lines

  1. Depends on what you claim an Ellipse can do.  Ex: suppose Ellipse has a 'scale(x,y)' method, which is meaningless for Circle.
  2.  
  3. There are no easy options at this point, but the worst of all possible worlds is to keep muddling along and hope that no one stubs their toes over the bad design (if we're serious about reuse, we should fix our mistakes rather than leave them to a future generation).  There are only two reasonable options:  
  4.  
  5. * realize that a Circle isn't a kind of an Ellipse-that-can-scale-unequally  
  6. * realize that not all Ellipses can scale their axes independently  
  7.  
  8. In the first case, Ellipse could be derived from class 'AsymmetricShape' (with scale(x,y) being introduced in AsymmetricShape), and Circle should be derived from 'SymmetricShape', which has a scale(factor) member fn.
  9.  
  10. In the second case, we could rename 'Ellipse' to 'Oval', then derive both Ellipse and Circle from Oval, where Ellipse (but not Oval nor Circle) has the unequal scale operation.